@BReplaceMergeCodes @P@ICopyright Gold Disk Inc., Jan, 1993
This Genie will search a document for merge codes which begin with the following sequence: ««= (for "«" press alt-9)
and end with : »» (for "»" press alt-0)
It expects to find between the merge codes a valid arexx command or macro which it will interpret. The merge codes will be replaced with the result of the interpreted command.
Example: if a box contained the following text:
"Hi there, today is ««=FormatDate("%w, %m %dth, %y")»»"
Then, running the macro would result with the following text being placed in the box:
"Hi there, today is Wednesday, January 26, 1992"
This Genie is very flexible because you may also execute disk resident
macros which query databases, etc..
*/
if ~show(l, "rexxsupport.library") then
if ~addlib("rexxsupport.library",0,-30) then
call exit_msg("Please install the rexxsupport.library in your libs: directory before running this Genie")
address command
call SafeEndEdit.rexx()
call ppm_AutoUpdate(0)
call ppm_SetBatchMode(1)
call ppm_ShowStatus("Working..")
box = ppm_DocFirstBox()
randval = (randu() * time(s))%1
do while box ~= 0
if upper(word(ppm_GetBoxInfo(box), 1)) ~= TEXT | ppm_GetBoxUserData(box) = randval then